What’s the analysis about?

The analysis of American coffee taste and global coffee consumption was performed to practice and show off data analytics skills with the R programming language. The analysis looks at data on how many cups of coffee a consumer drinks per day, their preferred roast levels, where they drink coffee and how they brew coffee at home. The last piece of analysis was about the consumption of coffee globally.

Introducing the dataset

The dataset was generated out of a survey and taste test performed by British YouTuber, James Hoffman. The data also includes survey results on a coffee taste test looking at roast levels and an experimental processing of some beans from Colombia as well. More than 4,000 people were surveyed, however, Hoffman, says the demographic is more representative of the audience for his YouTube channel with content mostly on coffee and less representative of the United States.

Data analysis

Cleaning the data and loading libraries

The data was available on Hoffman’s channel as a csv file, however, to be usable in R and easily readable, it required the renamed of several columns and removal of taste test data.

## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.4     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## Loading required package: viridisLite
## 
## 
## Attaching package: 'reshape2'
## 
## 
## The following object is masked from 'package:tidyr':
## 
##     smiths
## 
## 
## 
## Attaching package: 'plotly'
## 
## 
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## 
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## 
## The following object is masked from 'package:graphics':
## 
##     layout
## Rows: 4042 Columns: 113
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (44): Submission ID, What is your age?, How many cups of coffee do you t...
## dbl (13): Lastly, how would you rate your own coffee expertise?, Coffee A - ...
## lgl (56): Where do you typically drink coffee? (At home), Where do you typic...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Where consumers drink coffee the most

The vast majority of coffee drinkers have the beverage at home with a small number preferring to drink at a cafe and on the go. Since the pandemic, the trend of frequenting cafes has faded with regular consumers preferring to drink coffee at home over a cafe or while traveling or commuting.

## No id variables; using all as measure variables

Find interactive chart below:

interactive_plot_location
Drink at homeDrink at workDrink on the goDrink at a cafe0100020003000
1Most consumers drink coffee at home and at workLocationRespondents

Does age determine coffee consumption?

Most consumers drinks one to two cups of coffee per day and the most amount of coffee being consumed by the 25-34 age group with a small deviation upwards as some in that age group even have three to four cups per day. Older consumers do not drink more than 2 cups of coffee.

Find interactive chart below:

interactive_plot_heatmap
<18 years old18-24 years old25-34 years old35-44 years old45-54 years old55-64 years old>65 years old1234Less than 1More than 4
200400600800CountYounger coffee drinkers consume 1-2 cups per dayAgeCups per Day

What’s the most common brewing method at home?

Pour over and espressos are the most common brewing methods at home. A pour over set up is more inexpensive than some other brewing methods such as an espresso machine or a pod machine. However, the making espresso at home is also fairly common. This shows enthusiasts are happy to splurge on their brewing setup at home.

On the other hand, much fewer consumers prefer instant coffee and bean to cup machines, which are seen as brewing machines that deliver cups with less intricate flavor profiles.

## No id variables; using all as measure variables

Find interactive chart below:

interactive_plot_brewing
Pour overFrench PressEspressoBrewing machinePod machineInstant coffeeBean to cupCold brewCoffee extractOther0500100015002000
1Pour over is the most popular brewing method at homeBrewing methodRespondents

Roast preference of coffee drinkers

Most coffee drinkers prefer light and medium roasts with much fewer preferring dark roast coffees. However, when distributed by age, it becomes clearer that older consumers have a slightly higher preference of medium and darker roasts than younger consumers.

This shows the effects of the third wave of coffee that started at the turn of the century. The third wave of coffee is associated with the concept of specialty coffee which focuses on craft, quality, with origin flavor characteristics of coffee taking the limelight. Light roasts preserve origin characteristics better than darker roasts.

Find interactive chart below:

interactive_plot
LightMediumDark050010001500
Age<18 years old>65 years old18-24 years old25-34 years old35-44 years old45-54 years old55-64 years oldNAYounger coffee drinkers prefer lighter roastsRoast PreferenceCount

Where consumers buy their coffee

The vast majority of consumers buy coffee at specialty coffee shops, local cafes or coffee chains. This again shows the enthusiast nature of coffee drinkers of the sample used in the survey.

## No id variables; using all as measure variables

Find interactive chart below:

interactive_plot_purchase
Specialty coffee shopLocal cafeCoffee chainDrive thruSupermarketOther0100200300400
Coffee chainLocal cafeDrive thruSpecialty coffee shopSupermarketOtherMost consumers buy at a specialty coffee shop or a local cafeWhere consumers buy coffeeRespondents